import { useDialogStore } from '@/store'
import { DialogOptions } from '@/types'

const info = (options: DialogOptions) => {
	const dialogStore = useDialogStore()
	dialogStore.show('info', options)
}

const success = (options: DialogOptions) => {
	const dialogStore = useDialogStore()
	dialogStore.show('success', options)
}

const warning = (options: DialogOptions) => {
	const dialogStore = useDialogStore()
	dialogStore.show('warning', options)
}

const error = (options: DialogOptions) => {
	const dialogStore = useDialogStore()
	dialogStore.show('error', options)
}

export const useDialog = () => ({
	info,
	success,
	warning,
	error
})
